import * as types from "../types/helpCenterTypes";

const initialState = {
  loading: false,
  initing: true,
  error: undefined,
  content: undefined,
  abousContent: undefined,
};

export default function helpCenterReducerhomeReducer(state = initialState, action) {
  switch (action.type) {
    case types.HELPCENTER_INITING:
      return {
        ...state,
        initing: true,
      };
    case types.HELPCENTER_DONE:
      return {
        ...state,
        initing: false,
        loading: false,
        content: action.content,
      };
    case types.HELPCENTER_ERROR:
      return {
        ...state,
        initing: false,
        loading: false,
        error: action.error,
      };
    case types.ABOUS_INITING:
      return {
        ...state,
        initing: true,
      };
    case types.ABOUS_DONE:
      return {
        ...state,
        initing: false,
        loading: false,
        abousContent: action.abousContent,
      };
    case types.ABOUS_ERROR:
      return {
        ...state,
        initing: false,
        loading: false,
        error: action.error,
      };
    default:
      return state;
  }
}
